package order

import (
	"bee/pkg/logging"
	"bee/pkg/util"
	"github.com/go-resty/resty/v2"
)

func GetBossToken(appNamespace string) string {
	//appName := "boss"
	uri := "/xqy-portal-web/boss/login/base/login"

	client := resty.New()
	loginUser := make(map[string]string)
	loginUser["loginName"] = "pzm"
	loginUser["password"] = "a5eGNsovdGY="
	loginUser["rememberMe"] = "false"

	resp, _ := client.R().SetFormData(loginUser).
		Post("http://boss-manage-pc.boss-test.sit.91lyd.com" + uri)

	data := util.GetCookiesToMap(resp.Cookies())

	token := data["sso-epctoken"]
	logging.ZapLogger.Infow("获取的token", "token: ", token)
	return token
}
